package com.muyu.danmo.mapper;

import com.muyu.danmo.domain.DanmoTrainingInformation;
import com.muyu.danmo.domain.DanmoTrainingLikes;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 培训班点赞Mapper接口
 *
 * @author yangle
 * @date 2024-10-12
 */
public interface DanmoTrainingLikesMapper
{
    /**
     * 查询培训班点赞
     *
     * @param id 培训班点赞主键
     * @return 培训班点赞
     */
    public DanmoTrainingLikes selectDanmoTrainingLikesById(Long id);

    /**
     * 查询培训班点赞列表
     *
     * @param danmoTrainingLikes 培训班点赞
     * @return 培训班点赞集合
     */
    public List<DanmoTrainingLikes> selectDanmoTrainingLikesList(DanmoTrainingLikes danmoTrainingLikes);

    /**
     * 新增培训班点赞
     *
     * @param danmoTrainingLikes 培训班点赞
     * @return 结果
     */
    public int insertDanmoTrainingLikes(DanmoTrainingLikes danmoTrainingLikes);

    /**
     * 修改培训班点赞
     *
     * @param danmoTrainingLikes 培训班点赞
     * @return 结果
     */
    public int updateDanmoTrainingLikes(DanmoTrainingLikes danmoTrainingLikes);

    /**
     * 删除培训班点赞
     *
     * @param id 培训班点赞主键
     * @return 结果
     */
    public int deleteDanmoTrainingLikesById(Long id);

    /**
     * 批量删除培训班点赞
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteDanmoTrainingLikesByIds(Long[] ids);

    /**
     * 批量删除培训班详情
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteDanmoTrainingInformationByIds(Long[] ids);

    /**
     * 批量新增培训班详情
     *
     * @param danmoTrainingInformationList 培训班详情列表
     * @return 结果
     */
    public int batchDanmoTrainingInformation(List<DanmoTrainingInformation> danmoTrainingInformationList);


    /**
     * 通过培训班点赞主键删除培训班详情信息
     *
     * @param id 培训班点赞ID
     * @return 结果
     */
    public int deleteDanmoTrainingInformationById(Long id);

    boolean existsByUserIdAndTrainingClassId(@Param("userId") Long userId, @Param("trainingInformationId") Long trainingInformationId);

    Long countByTrainingClassId(@Param("trainingInformationId") Long trainingInformationId);

    void updateAmountPraise(@Param("trainingInformationId") Long trainingInformationId);

    List<DanmoTrainingLikes> selectDanmoTrainingLikesByIds(Long id);

    void deleteDanmoTrainingLikesByIdss(@Param("trainingInformationId") Long trainingInformationId);

    /**
     * 查询点赞
     * @param id
     * @param userid
     */
    DanmoTrainingLikes selectDanmoCollectMaterialByIdAndUserIdLiked(@Param("id") Long id, @Param("userid") Long userid);
}
